package com.beluga.core.pay;

public enum BPayChannel {

    /**
     * 支付宝支付
     */
    ALI_PAY("ALI_PAY","aliPayServiceImpl"),

    /**
     * 微信支付
     */
    WECHAT_PAY("WECHAT_PAY","wxPayServiceImpl"),

    /**
     * 云闪付支付
     */
    UNION_PAY("UNION_PAY","unionPayServiceImpl"),
    ;

    /**
     * 类型
     */
    private final String pay;

    private final String impl;

    BPayChannel(String pay,String impl) {
        this.pay = pay;
        this.impl=impl;
    }

    public String getPay() {
        return pay;
    }

    public String getImpl() {
        return impl;
    }


    public static String getImpl(String pay) {
        for (BPayChannel channel : BPayChannel.values()) {
            if (channel.pay.equals(pay)) {
                return channel.impl;
            }
        }
        return null;
    }


}
